#ifndef __MYBATTERY_H_
#define __MYBATTERY_H_

#include "stm32f1xx_hal.h"

struct BQ76940 {
    int battery[15];
    int Sum_val;
    int SOC;
    int current;
    int Temp_1;
    uint8_t CHG_STA;
    uint8_t DSG_STA;
};

void BQ76940_unpack(void);

void MyBatteryProtect_Loop(void);

void OV_Protect(void);

void UV_Protect(void);

void OC_Protect(void);

void Temp_Protect(void);

void printf_battery(void);

uint8_t IsInBatteryArray(int id);

void VOFA_Print(void);

void MyBatteryChangeMOS(void);

#endif